package com.zcy.gift.client.fallback;

import com.zcy.gift.client.AuthClient;
import com.zcy.gift.domain.LoginUser;
import com.zcy.gift.util.AjaxResult;
import feign.hystrix.FallbackFactory;

/**
 * <p>
 *
 * </p>
 *
 * @author lucker
 * @date 2024/1/24 18:43
 */
//@Component
public class AuthFallBackFactory implements FallbackFactory<AuthClient> {
    @Override
    public AuthClient create(Throwable throwable) {
        return new AuthClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return AjaxResult.error("服务异常，登录信息更新失败", 500);
            }
        };
    }
}
